package cn.stevenyang;

import cn.stevenyang.gen.BasicParserLexer;
import cn.stevenyang.gen.BasicParserParser;
import org.antlr.v4.runtime.CharStreams;
import org.antlr.v4.runtime.CommonTokenStream;

public class Launcher {

    public static void main(String[] args) {

        String code = CommonIO.readWholeFile(args[0]);

        assert code != null;
        BasicParserLexer lexer = new BasicParserLexer(CharStreams.fromString(code));
        CommonTokenStream tokenStream = new CommonTokenStream(lexer);
        BasicParserParser parser = new BasicParserParser(tokenStream);

        BasicParserParser.ProcessContext tree = parser.process();
        BasicInterpreter interpreter = new BasicInterpreter();
        interpreter.visit(tree);

    }

}
